// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file nsIUrlClassifierHashCompleter.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    /// This interface is implemented by nsIUrlClassifierHashCompleter clients.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("da16de40-df26-414d-bde7-c4faf4504868")]
	public interface nsIUrlClassifierHashCompleterCallback
	{
		
		/// <summary>
        /// A complete hash has been found that matches the partial hash.
        /// This method may be called 0-n times for a given
        /// nsIUrlClassifierCompleter::complete() call.
        ///
        /// @param hash
        /// The 128-bit hash that was discovered.
        /// @param table
        /// The name of the table that this hash belongs to.
        /// @param chunkId
        /// The database chunk that this hash belongs to.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Completion([MarshalAs(UnmanagedType.LPStruct)] nsACStringBase hash, [MarshalAs(UnmanagedType.LPStruct)] nsACStringBase table, uint chunkId);
		
		/// <summary>
        /// The completion is complete.  This method is called once per
        /// nsIUrlClassifierCompleter::complete() call, after all completion()
        /// calls are finished.
        ///
        /// @param status
        /// NS_OK if the request completed successfully, or an error code.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void CompletionFinished(int status);
	}
	
	/// <summary>
    /// Clients updating the url-classifier database have the option of sending
    /// partial (32-bit) hashes of URL fragments to be blacklisted.  If the
    /// url-classifier encounters one of these truncated hashes, it will ask an
    /// nsIUrlClassifierCompleter instance to asynchronously provide the complete
    /// hash, along with some associated metadata.
    /// This is only ever used for testing and should absolutely be deleted (I
    /// think).
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("231fb2ad-ea8a-4e63-a331-eafc3b434811")]
	public interface nsIUrlClassifierHashCompleter
	{
		
		/// <summary>
        /// Request a completed hash from the given gethash url.
        ///
        /// @param partialHash
        /// The 32-bit hash encountered by the url-classifier.
        /// @param gethashUrl
        /// The gethash url to use.
        /// @param callback
        /// An nsIUrlClassifierCompleterCallback instance.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Complete([MarshalAs(UnmanagedType.LPStruct)] nsACStringBase partialHash, [MarshalAs(UnmanagedType.LPStruct)] nsACStringBase gethashUrl, [MarshalAs(UnmanagedType.Interface)] nsIUrlClassifierHashCompleterCallback callback);
	}
}
